// import React from 'react'
import ReactDOM from 'react-dom'

const username = '吴签'
let num = 55

const loading = false
function render() {
  // if (loading) {
  //   return <div>数据正在加载中...</div>
  // } else {
  //   return <div>数据加载完成</div>
  // }
  return loading ? (<div>数据正在加载中...</div>) : (<div>数据加载完成</div>)
}
let list = [1, 2, 3, 4, 5]
// React.Fragment
const element = (
  <>
    <div>
      <h1>jsx的表达式</h1>
      <p>姓名:{username}</p>
      <p>数字:{num > 50 ? '成功' : '失败'}</p>
      {render()}
      {loading && <div>数据加载中</div>}
      <ul>
        {list.map((item, index) => (
          <li key={index}>{item}</li>
        ))}
      </ul>
      {list.map(item => item)}
    </div>

  </>
)
// console.log(element);
ReactDOM.render(element, document.getElementById('root'))